#include "stdafx.h"
#include "SpaceGame.h"

//setup an enumeration so we can refer to the textures by name rather than by number
static enum TextureNames
		{
			NO_TEXTURE, //0 is never used for texture mapping - OpenGL just won't assign this as a name for a texture binding
			BACKGROUND,
			ALIEN1,
			ALIEN2,
			MISSILEBASE,
			SHIELD
		};

CSpaceGame::CSpaceGame(void)
{
	Setup();
}


CSpaceGame::~CSpaceGame(void)
{
}


void
CSpaceGame::Setup()
{
	CTextureLoader::getInstance()->CreateTexture("assets/invadersbg.bmp", BACKGROUND);
	CTextureLoader::getInstance()->CreateTexture("assets/alien1.tga", ALIEN1);
	CTextureLoader::getInstance()->CreateTexture("assets/alien2.tga", ALIEN2);
	CTextureLoader::getInstance()->CreateTexture("assets/mbase.tga", MISSILEBASE);
	//create some sprites

	AddSprite(new CSprite(0, 0, 7, 5, BACKGROUND));

	AddSprite(new CMissileBase(0,-1,0.5,0.5,MISSILEBASE));

	for (int i=0; i<12; i++)
	{
	AddSprite(new CAlien(-3+0.5*i,0,0.5,0.5,ALIEN1));
	}
}